﻿using System.Collections;
using UnityEngine;


public class RoleShowController : MonoBehaviour
{
    public GameObject play;

    public void LoadRole(string name)
    {
        CloseRole();
        RoleAsset rolePrefab = Resources.Load<RoleAsset>(name);
        play = Instantiate(rolePrefab.prefab,transform.position,transform.rotation,transform);
       
    }

    public void CloseRole()
    {
        if (play != null)
        {
            Destroy(play);
            play = null;
        }
         
    }
}
